#ifndef COUPLE_H
#define COUPLE_H

/*
 * class to store couple of related indexes of int type (TODO: use templates instead of int)
 * type couple can be compared and hashed
 */
class couple
{
public:
    couple(int a=0, int b=0)
    {
        //sort values to simple comparsion
        if (a<b){
            firstIndex=a;
            secondIndex=b;
        } else {
            firstIndex=b;
            secondIndex=a;
        }
    }

    //int first(){return firstIndex;}
    //int second(){return secondIndex;}

    friend inline bool operator==(const couple& c1, const couple& c2){
        return (c1.firstIndex==c2.firstIndex && c1.secondIndex==c2.secondIndex);
    }

    friend inline uint qHash(const couple &key){
        return key.firstIndex*key.secondIndex;
    }

private:
   int firstIndex;
   int secondIndex;
};

#endif // COUPLE_H
